#include "mystdio.h"
#include <string.h>
#include <unistd.h>

int main()
{
    Myfile* file = myFopen("log.txt", "a");
    if(file == NULL)
    {
        perror("myFopen error\n");
        return 1;
    }
    int cnt = 10;
    const char* msg = "hello myfile";
    while(cnt--)
    {
        myFwrite(msg, strlen(msg), file);
        myFflush(file);
        printf("buffer:%s\n", file->buffer);
        sleep(1);
    }
    myFclose(file);

    return 0;
}
